package com.config.tomcat.lifecycle;

import org.apache.catalina.Host;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;

/**
 * @author chengyadong
 * @date 2023/9/21 17:14
 * @description host组件声明周期监听器
 */
public class HostLifecycleListener implements LifecycleListener {
	@Override
	public void lifecycleEvent(LifecycleEvent event) {
		Host host = (Host) event.getLifecycle();
		if(event.getType().equals(Lifecycle.BEFORE_INIT_EVENT)){
			System.out.println("host组件开始初始化:="+host.getName());
		}
	}
}
